//
//  UIBarButtonItem.swift
//  EyeVisionForPatients
//
//  Created by TT on 2020/2/7.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    convenience init(imageName: String, target: Any?, action: Selector) {
        let btn = UIButton(type: .custom)
        btn.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage(UIImage(named: imageName), for: .highlighted)
        btn.addTarget(target, action: action, for: .touchUpInside)
        
        self.init(customView: btn)
    }
}
